<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@include file="/includes/taglibs.jsp"%>
<%@page import="com.feib.soeasy.util.UserUtil"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><%=UserUtil.getCurrentMenuItemName() %></title>
	<script type="text/javascript" src="<c:url value='/scripts/jquery/jquery.bgiframe-2.1.2.js'/>"></script>
	
	<script type="text/javascript">
	<!--	
	$(document).ready(function() {
		
		$('#channelAll').click(function() {
			
			   var e = $('#channelAll')[0].checked;
			   var selectedDate=$('#qryDateFromAll').val();
			   var selectedDateTo=$('#qryDateToAll').val();
	            $('#qryPaymentFormDiv input:checkbox.chk').each(function(){               
	                this.checked = e;
	            });
	            if(e){	
	            	$('#qryDateFromD').val(selectedDate); 
		 			$('#qryDateFromE').val(selectedDate);
		 			$('#qryDateFromF').val(selectedDate);
		 			$('#qryDateFromG').val(selectedDate);
		 			$('#qryDateFromH').val(selectedDate);
		 		
		 		
		 			$('#qryDateToD').val(selectedDateTo);
		 			$('#qryDateToE').val(selectedDateTo);
		 			$('#qryDateToF').val(selectedDateTo);
		 			$('#qryDateToG').val(selectedDateTo);
		 			$('#qryDateToH').val(selectedDateTo);
		 			}
		});
		
		
		$('#doAjaxQueryPostBtn').click(function() {
			var errMsg = "";
			<%if ( UserUtil.isBankGroup()){ %>
			var groupNo = $('#group\\.groupNo').val();		
					$('#hidden\\.qryGroup\\.groupNo').val(groupNo);
			<%}%>
					
			var transfered =$("input[name='transfered']:checked").val();
			
			var qryDateFromH = $('#qryDateFromH').val();
			var qryDateToH = $('#qryDateToH').val();
			
			var channelH = $('#channelH').val();

			
			$('#hidden\\.transfered').val(transfered);
			
			$('#hidden\\.qryDateFromH').val(qryDateFromH);
			$('#hidden\\.qryDateToH').val(qryDateToH);
			
			$('#hidden\\.channelD').val('');
			
			$('#hidden\\.channelE').val('');
			
			$('#hidden\\.channelF').val('');
			
			$('#hidden\\.channelG').val('');
			
			if($('#channelH').attr("checked"))
				$('#hidden\\.channelH').val(channelH);
			else
				$('#hidden\\.channelH').val('');
			
			if($('#queryGroupType0').attr("checked"))
				$('#hidden\\.groupType\\[0\\]').val(3);
			else
				$('#hidden\\.groupType\\[0\\]').val('');
			
			
			if($('#queryGroupType1').attr("checked"))
				$('#hidden\\.groupType\\[1\\]').val(2);
			else
				$('#hidden\\.groupType\\[1\\]').val('');
		
			
			$('#method').attr('name','doAjaxQueryPost');
			
			
			doQueryAction();
		});
		
		$('#doQueryBtn').click(function() {
			var errMsg = "";
			<%if ( UserUtil.isBankGroup()){ %>
			var groupNo = $('#group\\.groupNo').val();		
					$('#hidden\\.qryGroup\\.groupNo').val(groupNo);
			<%}%>
			
			var transfered =$("input[name='transfered']:checked").val();
			
			
			var qryDateFromD = $('#qryDateFromD').val();
			var qryDateToD = $('#qryDateToD').val();
			var qryDateFromE = $('#qryDateFromE').val();
			var qryDateToE = $('#qryDateToE').val();
			var qryDateFromF = $('#qryDateFromF').val();
			var qryDateToF = $('#qryDateToF').val();
			var qryDateFromG = $('#qryDateFromG').val();
			var qryDateToG = $('#qryDateToG').val();
			var qryDateFromH = $('#qryDateFromH').val();
			var qryDateToH = $('#qryDateToH').val();
			
			var channelD = $('#channelD').val();
			var channelE = $('#channelE').val();
			var channelF = $('#channelF').val();
			var channelG = $('#channelG').val();
			var channelH = $('#channelH').val();
			
			
			
			
			
			$('#hidden\\.qryDateFromD').val(qryDateFromD);
			$('#hidden\\.qryDateToD').val(qryDateToD);

			$('#hidden\\.qryDateFromE').val(qryDateFromE);
			$('#hidden\\.qryDateToE').val(qryDateToE);

			$('#hidden\\.qryDateFromF').val(qryDateFromF);
			$('#hidden\\.qryDateToF').val(qryDateToF);

			$('#hidden\\.qryDateFromG').val(qryDateFromG);
			$('#hidden\\.qryDateToG').val(qryDateToG);

			
			if($('#channelD').attr("checked"))
				$('#hidden\\.channelD').val(channelD);
			else
				$('#hidden\\.channelD').val('');
			
			if($('#channelE').attr("checked"))
				$('#hidden\\.channelE').val(channelE);
			else
				$('#hidden\\.channelE').val('');
			
			if($('#channelF').attr("checked"))
				$('#hidden\\.channelF').val(channelF);
			else
				$('#hidden\\.channelF').val('');
			
			if($('#channelG').attr("checked"))
				$('#hidden\\.channelG').val(channelG);
			else
				$('#hidden\\.channelG').val('');
			
			$('#hidden\\.channelH').val('');
			
			if($('#queryGroupType0').attr("checked"))
				$('#hidden\\.groupType\\[0\\]').val(3);
			else
				$('#hidden\\.groupType\\[0\\]').val('');
			
			
			if($('#queryGroupType1').attr("checked"))
				$('#hidden\\.groupType\\[1\\]').val(2);
			else
				$('#hidden\\.groupType\\[1\\]').val('');
	
			
			
			$('#method').attr('name','doAjaxQuery');
	
			
			if (0 != errMsg.length){
				$("#ajaxErrorMessageDiv").html(errMsg);
				$("#ajaxErrorMessageDiv" ).dialog({  
					title:'請修正下列錯誤' 
					,width: 300
					, resizable: false
					, modal: true
					, buttons: {
						Ok: function() {
							$( this ).dialog( "close" );
						}
					}
				});
				return false;
			}
			
			$('#method').attr('name','doAjaxQuery');
			
			
			doQueryAction();
		});
		
		var dates = $( "#qryDateFrom, #qryDateTo" ).datepicker({
			defaultDate: "-1m",
			changeMonth: true,
			changeYear: true,
			numberOfMonths: 1,
			dateFormat: 'yy/mm/dd',
			showButtonPanel: true,
			showOn: "both",
			buttonImage: "<c:url value='styles/default/images/calendar.gif'/>",
			buttonImageOnly: true,
			onSelect: function( selectedDate ) {
				var option = this.id == "qryDateFrom" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" );
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates.not( this ).datepicker( "option", option, date );
			}
		});
		

		

		var dates2 = $( "#qryDateFromD, , #qryDateToD").datepicker({
			defaultDate: "-1m",
			changeMonth: true,
			changeYear: true,
			numberOfMonths: 1,
			dateFormat: 'yy/mm/dd',
			showButtonPanel: true,
			showOn: "both",
			buttonImage: "<c:url value='styles/default/images/calendar.gif'/>",
			buttonImageOnly: true,
			onSelect: function( selectedDate ) {
				var option = this.id == "qryDateFromD" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" );
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates2.not( this ).datepicker( "option", option, date );
			}
		});

		var dates3 = $( "#qryDateFromE, #qryDateToE").datepicker({
			defaultDate: "-1m",
			changeMonth: true,
			changeYear: true,
			numberOfMonths: 1,
			dateFormat: 'yy/mm/dd',
			showButtonPanel: true,
			showOn: "both",
			buttonImage: "<c:url value='styles/default/images/calendar.gif'/>",
			buttonImageOnly: true,
			onSelect: function( selectedDate ) {
				var option = this.id == "qryDateFromE" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" );
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates3.not( this ).datepicker( "option", option, date );
			}
		});

		var dates4 = $( "#qryDateFromF, #qryDateToF").datepicker({
			defaultDate: "-1m",
			changeMonth: true,
			changeYear: true,
			numberOfMonths: 1,
			dateFormat: 'yy/mm/dd',
			showButtonPanel: true,
			showOn: "both",
			buttonImage: "<c:url value='styles/default/images/calendar.gif'/>",
			buttonImageOnly: true,
			onSelect: function( selectedDate ) {
				var option = this.id == "qryDateFromF" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" );
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates4.not( this ).datepicker( "option", option, date );
			}
		});

		var dates5 = $( "#qryDateFromG, #qryDateToG").datepicker({
			defaultDate: "-1m",
			changeMonth: true,
			changeYear: true,
			numberOfMonths: 1,
			dateFormat: 'yy/mm/dd',
			showButtonPanel: true,
			showOn: "both",
			buttonImage: "<c:url value='styles/default/images/calendar.gif'/>",
			buttonImageOnly: true,
			onSelect: function( selectedDate ) {
				var option = this.id == "qryDateFromG" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" );
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates5.not( this ).datepicker( "option", option, date );
			}
		});

		var dates6 = $( "#qryDateFromH, #qryDateToH").datepicker({
			defaultDate: "-1m",
			changeMonth: true,
			changeYear: true,
			numberOfMonths: 1,
			dateFormat: 'yy/mm/dd',
			showButtonPanel: true,
			showOn: "both",
			buttonImage: "<c:url value='styles/default/images/calendar.gif'/>",
			buttonImageOnly: true,
			onSelect: function( selectedDate ) {
				var option = this.id == "qryDateFromH" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" );
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates6.not( this ).datepicker( "option", option, date );
			}
		});
		
		var dates7 = $( "#qryDateFromAll, #qryDateToAll").datepicker({
			defaultDate: "-1m",
			changeMonth: true,
			changeYear: true,
			numberOfMonths: 1,
			dateFormat: 'yy/mm/dd',
			showButtonPanel: true,
			showOn: "both",
			buttonImage: "<c:url value='styles/default/images/calendar.gif'/>",
			buttonImageOnly: true,
			onSelect: function( selectedDate ) {
				var option = this.id == "qryDateFromAll" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" );
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				
				 var e = $('#channelAll')[0].checked;
				 if(e){					 	
					 	if(this.id == "qryDateFromAll"){
					 		$('#qryDateFromD').val(selectedDate); 
					 		$('#qryDateFromE').val(selectedDate);
					 		$('#qryDateFromF').val(selectedDate);
					 		$('#qryDateFromG').val(selectedDate);
					 		$('#qryDateFromH').val(selectedDate);
					 		
					 		}else{
					 			$('#qryDateToD').val(selectedDate);
					 			$('#qryDateToE').val(selectedDate);
					 			$('#qryDateToF').val(selectedDate);
					 			$('#qryDateToG').val(selectedDate);
					 			$('#qryDateToH').val(selectedDate);
					 	}
					 	dates7.not( this ).datepicker( "option", option, date );
					 }
				
			}
		});
	
	
	});
		
	

	jQuery.download = function(url, data, method){
		//url and data options required
		//alert(url);
		//alert(data);
		if( url && data ){
			
			//data can be string of parameters or array/object
			data = typeof data == 'string' ? data : jQuery.param(data);
			//split params into form inputs
			//send request
			if (null == $('#myIFrm')){
				jQuery('<iframe id="myIFrm" src="' + url + '?'+ data +'" style="display:none; visibility: hidden;"></iframe>').appendTo('body');
			}
			else {
				$('#myIFrm').attr("src", url + '?'+ data );
			}
			
			
		};
	};
	
	function doDownloadExcelFileAction()
	{
		$('#method').attr('name','doAjaxDownloadExcelFile');
		$.download("<c:url value='/ajax/Soez6001.action'/>",$("#queryPaymentHiddenForm").serialize() );		
	}

	function doDownloadDetailExcelFileBtn(channel , commissionCode, qryDateForm , qryDateTo)
	{
	 	
		$('#method4').attr('name','doDownloadDetailExcelFile');
		$.download("<c:url value='/ajax/Soez6001.action'/>",$("#queryCommissionHiddenFrom").serialize() );	
	}
	
	
	
	function doQueryAction()
	{
		$("#queryResultDiv").fadeTo("slow", 0.1);
	
		waitingDialog({});
		$.ajax({url : "<c:url value='/ajax/Soez6001.action'/>",
			async : true,
			type : 'POST',
			data : $("#queryPaymentHiddenForm").serialize(),
			dataType : 'html',
			success : function(data, textStatus, XMLHttpRequest){
					$("#queryResultDiv").html(data);					
				},
			error : function(XMLHttpRequest, textStatus, errorThrown){
				$("#ajaxErrorMessageDiv").html('系統發生錯誤，請聯絡管理員');
				$("#ajaxErrorMessageDiv" ).dialog({  
					title:'系統錯誤' 
					,width: 600
					, resizable: false
					, modal: true
					, buttons: {
						Ok: function() {
							$( this ).dialog( "close" );
						}
					}
				});
				},
			complete: function(XMLHttpRequest, textStatus){
				closeWaitingDialog();
				$("#queryResultDiv").fadeTo("slow", 1);
			}
		});
	}
	/* 查詢單通路總計  */
	function doQueryChannelAction(uid)
	{

		var channel = uid.substr(0,1);
		var yyyy=uid.substr(1,4);
		var mm=uid.substr(5,2);
		var dd=uid.substr(7,2);
		
		var qryDateFrom=new Date(yyyy,mm-1,dd);
		var qryDateTo=new Date(yyyy,mm-1,dd);
		
		qryDateFrom=$.datepicker.formatDate( "yy/mm/dd", qryDateFrom );
		qryDateTo=$.datepicker.formatDate( "yy/mm/dd", qryDateTo );
		
		var qryGroupNo=uid.substr(9,22);
	
		$("#queryCommissionCodeResultDiv").dialog( "destroy" );
		$('#hidden\\.detailType').val(2);
		$('#method4').attr('name','doAjaxQueryTotalCommissionCode');
		$('#hidden\\.queryChannel').val(channel);
		$('#hidden2\\.qryGroup\\.groupNo').val(qryGroupNo);		
		$('#hidden2\\.qryDateFrom').val(qryDateFrom);
		$('#hidden2\\.qryDateTo').val(qryDateTo);	

		$('#hidden2\\.queryResult\\.pageNumber').val(1);
		waitingDialog({});
		$.ajax({url : "<c:url value='/ajax/Soez6001.action'/>",
			async : true,
			type : 'POST',
			data : $("#queryCommissionHiddenFrom").serialize(),
			dataType : 'html',
			success : function(data, textStatus, XMLHttpRequest){
				$("#queryCommissionCodeResultDiv").html(data);
				$("#queryCommissionCodeResultDiv" ).dialog({  
                    title:'明細資料' 
                    ,width: 800
                    , resizable: false
                    , modal: true
                });
				},
			error : function(XMLHttpRequest, textStatus, errorThrown){
					$("#ajaxErrorMessageDiv").html('系統發生錯誤，請聯絡管理員');
					$("#ajaxErrorMessageDiv" ).dialog({  
						title:'系統錯誤' 
						,width: 600
						, resizable: false
						, modal: true
						, buttons: {
							Ok: function() {
								$( this ).dialog( "close" );
							}
						}
					});
				},
				complete: function(XMLHttpRequest, textStatus){
					closeWaitingDialog();
					$("#queryCommissionCodeResultDiv").fadeTo("slow", 1);
				}
		});

	}

	/* 查詢單一業者全通路總計  */
	function doQueryGroupAllChannelAction(uid)
	{

		var yyyy=uid.substr(0,4);
		var mm=uid.substr(4,2);
		var dd=uid.substr(6,2);
		
		var qryDateFrom=new Date(yyyy,mm-1,dd);
		var qryDateTo=new Date(yyyy,mm-1,dd);
		
		qryDateFrom=$.datepicker.formatDate( "yy/mm/dd", qryDateFrom );
		qryDateTo=$.datepicker.formatDate( "yy/mm/dd", qryDateTo );
		
		var qryGroupNo=uid.substr(8,22);
	
		$("#queryCommissionCodeResultDiv").dialog( "destroy" );
		$('#hidden\\.detailType').val(3);
		$('#method4').attr('name','doAjaxQueryTotalCommissionCode');
		$('#hidden\\.queryChannel').val('');
		$('#hidden2\\.qryGroup\\.groupNo').val(qryGroupNo);		
		$('#hidden2\\.qryDateFrom').val(qryDateFrom);
		$('#hidden2\\.qryDateTo').val(qryDateTo);	

		$('#hidden2\\.queryResult\\.pageNumber').val(1);
		waitingDialog({});
		$.ajax({url : "<c:url value='/ajax/Soez6001.action'/>",
			async : true,
			type : 'POST',
			data : $("#queryCommissionHiddenFrom").serialize(),
			dataType : 'html',
			success : function(data, textStatus, XMLHttpRequest){
				$("#queryCommissionCodeResultDiv").html(data);
				$("#queryCommissionCodeResultDiv" ).dialog({  
                    title:'明細資料' 
                    ,width: 800
                    , resizable: false
                    , modal: true
                });
				},
			error : function(XMLHttpRequest, textStatus, errorThrown){
					$("#ajaxErrorMessageDiv").html('系統發生錯誤，請聯絡管理員');
					$("#ajaxErrorMessageDiv" ).dialog({  
						title:'系統錯誤' 
						,width: 600
						, resizable: false
						, modal: true
						, buttons: {
							Ok: function() {
								$( this ).dialog( "close" );
							}
						}
					});
				},
				complete: function(XMLHttpRequest, textStatus){
					closeWaitingDialog();
					$("#queryCommissionCodeResultDiv").fadeTo("slow", 1);
				}
		});

	}
	
	/* 查詢全通路總計  */
	function doQueryAllGroupAction(uid)
	{

		var yyyy=uid.substr(0,4);
		var mm=uid.substr(4,2);
		var dd=uid.substr(6,2);
		
		//var qryDateFrom=new Date(yyyy,mm-1,dd);
		//var qryDateTo=new Date(yyyy,mm-1,dd);
		
		var qryDateFrom=$('#hidden\\.qryDateFrom').val();
		var qryDateTo=$('#hidden\\.qryDateTo').val();		
		
		//qryDateFrom=$.datepicker.formatDate( "yy/mm/dd", qryDateFrom );
		//qryDateTo=$.datepicker.formatDate( "yy/mm/dd", qryDateTo );
		//以查詢條件的總通路為基準　沒輸入就不用
		var qryGroupNo=$('#hidden\\.qryGroup\\.groupNo').val();
		
		$("#queryCommissionCodeResultDiv").dialog( "destroy" );
		$('#hidden\\.detailType').val(3);
		$('#method4').attr('name','doAjaxQueryTotalCommissionCode');
		$('#hidden\\.queryChannel').val('');
		$('#hidden2\\.qryGroup\\.groupNo').val(qryGroupNo);		
		$('#hidden2\\.qryDateFrom').val(qryDateFrom);
		$('#hidden2\\.qryDateTo').val(qryDateTo);	

		$('#hidden2\\.queryResult\\.pageNumber').val(1);
		waitingDialog({});
		$.ajax({url : "<c:url value='/ajax/Soez6001.action'/>",
			async : true,
			type : 'POST',
			data : $("#queryCommissionHiddenFrom").serialize(),
			dataType : 'html',
			success : function(data, textStatus, XMLHttpRequest){
				$("#queryCommissionCodeResultDiv").html(data);
				$("#queryCommissionCodeResultDiv" ).dialog({  
                    title:'明細資料' 
                    ,width: 800
                    , resizable: false
                    , modal: true
                });
				},
			error : function(XMLHttpRequest, textStatus, errorThrown){
					$("#ajaxErrorMessageDiv").html('系統發生錯誤，請聯絡管理員');
					$("#ajaxErrorMessageDiv" ).dialog({  
						title:'系統錯誤' 
						,width: 600
						, resizable: false
						, modal: true
						, buttons: {
							Ok: function() {
								$( this ).dialog( "close" );
							}
						}
					});
				},
				complete: function(XMLHttpRequest, textStatus){
					closeWaitingDialog();
					$("#queryCommissionCodeResultDiv").fadeTo("slow", 1);
				}
		});

	}
	
	
	/* 查詢單通路總計 換頁 */
	function doQueryChannelActionPage(pageNumber)
	{
		if (null != pageNumber)
			$('#hidden2\\.queryResult\\.pageNumber').val(pageNumber);
			
		$('#hidden\\.detailType').val(2);
		$("#queryCommissionCodeResultDiv").dialog( "destroy" );;
		$('#method4').attr('name','doAjaxQueryTotalCommissionCode');
		waitingDialog({});
		$.ajax({url : "<c:url value='/ajax/Soez6001.action'/>",
			async : true,
			type : 'POST',
			data : $("#queryCommissionHiddenFrom").serialize(),
			dataType : 'html',
			success : function(data, textStatus, XMLHttpRequest){
				$("#queryCommissionCodeResultDiv").html(data);
				$("#queryCommissionCodeResultDiv" ).dialog({  
                    title:'明細資料' 
                    ,width: 800
                    , resizable: false
                    , modal: true
                });
				},
			error : function(XMLHttpRequest, textStatus, errorThrown){
					$("#ajaxErrorMessageDiv").html('系統發生錯誤，請聯絡管理員');
					$("#ajaxErrorMessageDiv" ).dialog({  
						title:'系統錯誤' 
						,width: 600
						, resizable: false
						, modal: true
						, buttons: {
							Ok: function() {
								$( this ).dialog( "close" );
							}
						}
					});
				},
				complete: function(XMLHttpRequest, textStatus){
					closeWaitingDialog();
					$("#queryCommissionCodeResultDiv").fadeTo("slow", 1);
				}
		});

	}
	
	
	/* 查詢全通路總計 換頁 */
	function doQueryTotalAction(pageNumber)
	{
		if (null != pageNumber)
		$('#hidden2\\.queryResult\\.pageNumber').val(pageNumber);
		$('#method4').attr('name','doAjaxQueryTotalCommissionCode');
		$("#queryCommissionCodeResultDiv").dialog( "destroy" );
		$('#hidden\\.detailType').val(3);
		waitingDialog({}); 
		$.ajax({url : "<c:url value='/ajax/Soez6001.action'/>",
			async : true,
			type : 'POST',
			data : $("#queryCommissionHiddenFrom").serialize(),
			dataType : 'html',
			success : function(data, textStatus, XMLHttpRequest){
					$("#queryCommissionCodeResultDiv").html(data);
					$("#queryCommissionCodeResultDiv" ).dialog({  
	                    title:'明細資料' 
	                    ,width: 800
	                    , resizable: false
	                    , modal: true
	                });
				},
			error : function(XMLHttpRequest, textStatus, errorThrown){
				$("#ajaxErrorMessageDiv").html('系統發生錯誤，請聯絡管理員');
				$("#ajaxErrorMessageDiv" ).dialog({  
					title:'系統錯誤' 
					,width: 600
					, resizable: false
					, modal: true
					, buttons: {
						Ok: function() {
							$( this ).dialog( "close" );
						}
					}
				});
				},
			complete: function(XMLHttpRequest, textStatus){
				closeWaitingDialog();
				$("#queryCommissionCodeResultDiv").fadeTo("slow", 1);
			}
		});
	}
	
	

	
	
	//-->
	</script>
</head>
<body>
<div id="mainAreaCT">
		<jsp:include page="/includes/path.jsp"/>
		<jsp:include page="/includes/subMenu.jsp"/>
		
	<div id="qryPaymentFormDiv">
		<stripes:form id="queryPaymentFrom" beanclass="com.feib.soeasy.action.Soez6001ActionBean" 
			method="post" onsubmit="javascript: return flase;">
			
			<table id="queryForm" >		
			<tr>					
				<th><stripes:radio id="transfered.0" name="transfered" value="0"/> </th>				
				<td>未撥款</td>							
				<th><stripes:radio id="transfered.1" name="transfered" value="1"/> </th>
				<td>已撥款</td>		
			</tr>
			<tr>					
				<th>
				<input name="queryGroupType[0]" 
						type="checkbox" id="queryGroupType0" value="2" />
		
				</th>				
				<td>雜項代收</td>							
				<th>
						<input name="queryGroupType[1]" 
						type="checkbox" id="queryGroupType1" value="3" />
		
				 </th>
				<td>學雜費代收</td>		
			</tr>

			</table>	
			<table id="queryForm" >
		
		    <tr>
				<th>
					<input name="channelAll" 
						type="checkbox" id="channelAll" value="all" class="chk"/>
				</th>
				<td>全部勾選</td>
				<th>銷帳日期<span id="mustKeyInStar">**</span></th>
				<td colspan="3">					
					<stripes:text id="qryDateFromAll" name="qryDateFromAll" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
					～
					<stripes:text id="qryDateToAll" name="qryDateToAll" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
				</td>
			</tr>
			<tr>
				<th>
					<input name="channelD" 
						type="checkbox" id="channelD" value="D" class="chk"/>
				</th>
				<td>統一超商</td>
				<th>銷帳日期<span id="mustKeyInStar">**</span></th>
				<td colspan="3">					
					<stripes:text id="qryDateFromD" name="qryDateFromD" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
					～
					<stripes:text id="qryDateToD" name="qryDateToD" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
				</td>
			</tr>
			<tr>
				<th>
					<input name="channelE" 
						type="checkbox" id="channelE" value="E" class="chk"/>
				</th>
				<td>全家超商</td>
				<th>銷帳日期<span id="mustKeyInStar">**</span></th>
				<td colspan="3">					
					<stripes:text id="qryDateFromE" name="qryDateFromE" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
					～
					<stripes:text id="qryDateToE" name="qryDateToE" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
				</td>
			</tr>
			<tr>
				<th>
					<input name="channelF" 
						type="checkbox" id="channelF" value="F" class="chk"/>
				</th>
				<td>萊爾富超商</td>
				<th>銷帳日期<span id="mustKeyInStar">**</span></th>
				<td colspan="3">					
					<stripes:text id="qryDateFromF" name="qryDateFromF" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
					～
					<stripes:text id="qryDateToF" name="qryDateToF" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
				</td>
			</tr>
			<tr>
				<th>
					<input name="channelG" 
						type="checkbox" id="channelG" value="G" class="chk"/>
				</th>
				<td>OK超商</td>
				<th>銷帳日期<span id="mustKeyInStar">**</span></th>
				<td colspan="3">					
					<stripes:text id="qryDateFromG" name="qryDateFromG" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
					～
					<stripes:text id="qryDateToG" name="qryDateToG" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
				</td>
			</tr>
			
			<tr>
				<td colspan="6" class="queryFunction">
					<stripes:button id="doQueryBtn" name="doQueryBtn" value="查詢" class="formBtn"/>
				</td>
			</tr>
		</table>
		
		<table id="queryForm" >	
			
			<tr>
				<th>
					<input name="channelH" 
						type="checkbox" id="channelH" value="H" class="chk"/>
				</th>
				<td>郵局</td>
				<th>銷帳日期<span id="mustKeyInStar">**</span></th>
				<td colspan="3">					
					<stripes:text id="qryDateFromH" name="qryDateFromH" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
					～
					<stripes:text id="qryDateToH" name="qryDateToH" size="10" maxlength="10" formatPattern="yyyy/MM/dd" readonly="true"/>
				</td>
			</tr>
			<tr>
				<td colspan="6" class="queryFunction">
					<stripes:button id="doAjaxQueryPostBtn" name="doAjaxQueryPostBtn" value="查詢" class="formBtn"/>
				</td>
			</tr>
		</table>
		</stripes:form>
	</div><!-- end #qryPaymentFormDiv -->
	
	
	<!-- 查詢結果  -->
	<div id="queryResultDiv" style="display: none;"></div>
	
	<div id="queryPaymentHiddenFormDiv" style="display: none;">
		<stripes:form id="queryPaymentHiddenForm" beanclass="com.feib.soeasy.action.Soez6001ActionBean" 
			method="post" onsubmit="javascript: return false;">
			<%if ( UserUtil.isBankGroup()){ %>
			<stripes:hidden id="hidden.qryGroup.groupNo" name="qryGroup.groupNo"/>
			<%} else {%>
			<input type="hidden" id="hidden.qryGroup.groupNo" name="qryGroup.groupNo" value="<%out.print(UserUtil.getUserGroup().getGroupNo());%>"/>
			<%} %>
				<stripes:hidden id="hidden.qryDateFromD" name="qryDateFromD" formatPattern="yyyy/MM/dd"/>
			<stripes:hidden id="hidden.qryDateToD" name="qryDateToD" formatPattern="yyyy/MM/dd"/>
			
			<stripes:hidden id="hidden.qryDateFromE" name="qryDateFromE" formatPattern="yyyy/MM/dd"/>
			<stripes:hidden id="hidden.qryDateToE" name="qryDateToE" formatPattern="yyyy/MM/dd"/>
			
			<stripes:hidden id="hidden.qryDateFromF" name="qryDateFromF" formatPattern="yyyy/MM/dd"/>
			<stripes:hidden id="hidden.qryDateToF" name="qryDateToF" formatPattern="yyyy/MM/dd"/>
			
			<stripes:hidden id="hidden.qryDateFromG" name="qryDateFromG" formatPattern="yyyy/MM/dd"/>
			<stripes:hidden id="hidden.qryDateToG" name="qryDateToG" formatPattern="yyyy/MM/dd"/>
			
			<stripes:hidden id="hidden.qryDateFromH" name="qryDateFromH" formatPattern="yyyy/MM/dd"/>
			<stripes:hidden id="hidden.qryDateToH" name="qryDateToH" formatPattern="yyyy/MM/dd"/>	
			
			<stripes:hidden id="hidden.channelD" name="channelD"/>
			<stripes:hidden id="hidden.channelE" name="channelE"/>
			<stripes:hidden id="hidden.channelF" name="channelF"/>
			<stripes:hidden id="hidden.channelG" name="channelG"/>
			<stripes:hidden id="hidden.channelH" name="channelH"/>>
			<stripes:hidden id="hidden.groupType[0]" name="groupN" />	
			<stripes:hidden id="hidden.groupType[1]" name="groupS" />			
			<stripes:hidden id="hidden.transfered" name="transfered" />	
			
			
			<input type="hidden" id="method" name="doAjaxQuery"/>
			
			
		</stripes:form>
	</div>
	
	<div id="paymentsItemDiv" style="display: none;"></div>


	<div id="queryCommissionCodeResultDiv" style="display: none; "></div>
	<div style="display: none; ">
		<stripes:form id="queryCommissionHiddenFrom" beanclass="com.feib.soeasy.action.Soez6001ActionBean" 
			method="post" onsubmit="javascript: return false;">
			<stripes:hidden id="hidden.queryChannel" name="queryChannel"/>
			<stripes:hidden id="hidden2.qryGroup.groupNo" name="qryGroup.groupNo" />	
			<stripes:hidden id="hidden2.qryDateFrom" name="qryDateFrom" formatPattern="yyyy/MM/dd"  />
			<stripes:hidden id="hidden2.qryDateTo" name="qryDateTo" formatPattern="yyyy/MM/dd"  />
			<stripes:hidden id="hidden.detailType" name="detailType"/>	
			<stripes:hidden id="hidden2.queryResult.pageNumber" name="queryResult.pageNumber" />		
			<input type="hidden" id="method4" name="doAjaxQueryTotalCommissionCode"/>
		</stripes:form>
	</div>



	
	<%if ( UserUtil.isBankGroup()){ %>
	<!-- 業者代號 查詢 -->
	<div id="findGroupDiv" style="display: none;">
	
		<div id="queryGroupDiv">
		<table>
			<tr>
				<th>業者代號</th>
				<td><input id="qryGroup.groupNo" type="text" size="12" maxlength="12" /> </td>
			</tr>
			<tr>
				<th>名稱</th>
				<td><input id="qryGroup.groupName" type="text" size="20" /></td>
			</tr>
			<tr>
				<td colspan="2" class="queryFunction">
					<input type="button" value="查詢" id="doAjaxQueryGroupsBtn"/>
					<input type="button" value="離開" id="doAjaxCloseGroupsBtn"/>
				</td>
			</tr>
		</table>
		</div>
		<div id="queryGroupResultDiv" style="display: none;">
		</div>
	
	</div>
	
	<div id="queryGroupHiddenFormDiv" style="display: none; ">
		<stripes:form id="queryGroupHiddenFrom" beanclass="com.feib.soeasy.action.Soez6001ActionBean" 
			method="post" onsubmit="javascript: return false;">
			<stripes:hidden id="hidden.qryGroup.groupName" name="qryGroup.groupName"/>
			<stripes:hidden id="hidden.qryGroup.groupNo" name="qryGroup.groupNo"/>
			<stripes:hidden id="hidden.queryGroupResult.pageNumber" name="queryGroupResult.pageNumber" />			
			<input type="hidden" id="method2" name="doAjaxQueryGroups"/>
		</stripes:form>
	</div>
	
	<div id="groupNochangedHiddenFromDiv" style="display: none; ">
		<stripes:form id="groupNochangedHiddenFrom" beanclass="com.feib.soeasy.action.Soez6001ActionBean" 
			method="post" onsubmit="javascript: return false;">
			<stripes:hidden id="hidden.qryGroup.groupNo1" name="qryGroup.groupNo"/>
			<input type="hidden" id="method3" name="doAjaxGroupNoChange"/>
		</stripes:form>
	</div>
	
	<%} %>
		
	<!-- Message -->
	<div id="ajaxErrorMessageDiv" style="display: none;"></div>
	
	<iframe id="myIFrm" src="" style="display:none; visibility: hidden;"></iframe>

</div>
</body>
</html>